package cn.jiedh.app.meiweidk.web.webhandle;

import android.content.Context;
import android.os.Bundle;
import android.support.v4.app.Fragment;

import cn.jiedh.app.meiweidk.Utils.tool.ActivityUtil;
import cn.jiedh.app.meiweidk.Utils.tool.L;
import cn.jiedh.app.meiweidk.loan.LoanDetailActivity;
import cn.jiedh.app.meiweidk.web.webkit.WJBridgeHandler;
import cn.jiedh.app.meiweidk.web.webkit.WJCallbacks;

/**
 * @name：
 * @author： liuyun
 * @phone： 15723310658
 * @createTime： 2017/12/19
 * @modifyTime： 2017/12/19
 * @explain：说明
 */


public class PushToLoanDetailHandle implements WJBridgeHandler {
    public static final String HANDLE_NAME="pushToLoanDetail";
    private Context mCox;
    private Fragment mFragment;

    public PushToLoanDetailHandle(Context mCox) {
        this.mCox = mCox;
    }

    public PushToLoanDetailHandle(Fragment mFragment) {
        this.mFragment = mFragment;
    }

    @Override
    public void handler(String data, WJCallbacks callbacks) {
        if(L.isDebug) {
            System.out.println("PushToLoanDetailHandle-----------------------------------------------------------------------------");
            System.out.println("data-->" + data);
        }
        Bundle bundle = new Bundle();
        bundle.putInt("productId", Integer.parseInt(data));
        ActivityUtil.next(mCox!=null?mCox:mFragment.getActivity(), LoanDetailActivity.class, bundle);

    }
}
